home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Electronic Messages / InfoMac Digests / InfoMac Vol. 6 / InfoMac 6.18 < prev    next >
Encoding:
Text File  |  1988-02-24  |  24.8 KB  |  735 lines  |  [TEXT/ttxt]

  1. INFO-MAC Digest          Monday, 22 Feb 1988       Volume 6 : Issue 18
  2.  
  3. Today's Topics:
  4.                         all of those fortran bugs
  5.  
  6.  
  7. ----------------------------------------------------------------------
  8.  
  9. Date: 17 Feb 88 18:01:00 EST
  10. From: <bouldin@ceee-sed.arpa>
  11. Subject: all of those fortran bugs
  12. Reply-to: <bouldin@ceee-sed.arpa>
  13.  
  14.  1: Date:  04-Nov-86 14:04 EST
  15.  2: From:  David Sloan [76475,3012]
  16.  3: Subj:  Absoft Fortran Bugs
  17.  4:
  18.  5: Mr. Bouldin,
  19.  6:
  20.  7: We are users of MS Fortran (V2.2) on a Macintosh Plus.
  21.  8: We have experienced several problems with the compiler
  22.  9: and would like to respond to your request to assemble
  23. 10: a list bugs. We would also appreciate a copy of your
  24. 11: current list of V2.2 bugs. If possible, could you please
  25. 12: forward this list via Compuserve to user id 76475, 3012.
  26. 13: Here are some of the more serious problems that we
  27. 14: have encountered:
  28. 15:
  29. 16: 1) Problem with incorrect array addressing for arrays
  30. 17:    with negative dimensions. The compiler assumes that
  31. 18:    the base address of the array corresponds to an index
  32. 19:    of 0.
  33. 20:       REAL X(0:N-1)
  34. 21:           .
  35. 22:           .
  36. 23:       CALL SUB (X, L, M)
  37. 24:           .
  38. 25:           .
  39. 26:       SUBROUTINE SUB (X, L, M)
  40. 27:       REAL X(-L:M)
  41. 28:           .
  42. 29:           .
  43. 30:       X(-1) = 0.0
  44. 31:           .
  45. 32:           .
  46. 33:    A location before the base of X will be overwritten.
  47. 34:
  48. 35: 2) Stack alignment is wrong after a call to a subroutine
  49. 36:    with many parameters. We have noticed problems calling
  50. 37:    a subroutine with 19 parameters.
  51. 38:
  52. 39: 3) Constant expressions don't seem to work in implied
  53. 40:    data statements. For example,
  54. 41:       PARAMETER (N=0, M=10)
  55. 42:       REAL X(1:10)
  56. 43:       DATA (X(I), I=N+1, M) /.../
  57. 44:    The N+1 term gives a compilation error.
  58. 45:
  59. 46: 4) A CHAR function in a parameter statement bombs the
  60. 47:    compiler. (Some compilers accept this construct.)
  61. 48:       CHARACTER TAB
  62. 49:       PARAMETER (TAB=CHAR(9))
  63. 50:
  64. 51: Please feel free to contact us by phone, or via
  65. 52: Compuserve. We do receive UUCP mail but I'm not
  66. 53: sure if we can send mail. The partial UUCP path is
  67. 54: bnr-mtl!bnr-vpa!utcs!utzoo and my Vax account is SLOAN.
  68. 55: My name, address, and phone number is:
  69. 56:
  70. 57:            David Sloan
  71. 58:        c/o Bell-Northern Research
  72. 59:            3 Place du Commerce
  73. 60:            Verdun, Quebec,
  74. 61:            Canada, H3E 1H6
  75. 62:            Telephone: (514) 765-7827
  76. 63:
  77. 64: Thank you for your time and effort.
  78. 65:
  79. 66:                  Regards,
  80. 67:
  81. 68:                     David
  82. 69:
  83. Date: Fri, 3 Apr 87 15:52:50 CST
  84. From: wmartin@ngp.utexas.edu (Wiley Sanders)
  85. Subject: Fix for bug in Macfortran call to SIZERESOURCE
  86.  
  87. There is an error in the file "resource.inc" supplied
  88. with MacFortran 2.2. The error is an incorrect value
  89. for the trap code for SIZERESOURCE. The old, incorrect
  90. value is: z'9A550000'. The correct value should be
  91. z'9A590000'. Without this correction, calling SIZERESOURCE
  92. will bomb. Credit goes to Dan Kampmeier, whose source to
  93. McFace gives the correct value of the trap code.
  94. -w
  95.  
  96. ------------------------------
  97.  
  98. Date: Fri 3 Apr 87 17:57:10-PST
  99. From: Tony Siegman  <SIEGMAN@Sierra.Stanford.EDU>
  100. Subject: Complex Variables in MS Fortran
  101.  
  102. In Microsoft Fortran the mini-program
  103.          DO 10 K=1,10
  104.          A=CMPLX(1.0,0.0)+K
  105.      10  WRITE (9,*) REAL(A),AIMAG(A)
  106. will compile without errors and produce the output
  107.          2.000  0.000
  108.          3.000  0.000
  109.           .....
  110. while the miniprogram
  111.          A0=CMPLX(1.0,0.0)
  112.          DO 10 K=1,10
  113.          A=A0+K
  114.      10  WRITE (9,*) REAL(A),AIMAG(A)
  115. will produce
  116.          2.000  1.000
  117.          3.000  2.000
  118.          4.000  3.000
  119.                .....
  120. In both cases the compiler reports that A is real, and the locations of A
  121. and K are four units apart.  I guess you have to be real careful when
  122. specifiying and using complex variables in MS Fortran!
  123.  
  124. ------------------------------
  125. From: traffic@ut-ngp.UUCP (Wiley Sanders)
  126. Subject: MacFortran: Bug or Feature?
  127. Date: 28 Apr 87 06:20:06 GMT
  128. Organization: UTexas Computation Center, Austin, Texas
  129.  
  130. There was something on the net a few days ago about a bug in the DATA
  131. statement to the effect that, if a is real,
  132.  
  133.       DATA (a(i),i=1,5) / 200.3, 345.6, 378.5, 500, 456.6/
  134.  
  135. will return a zero in a(4) because the decimal point is missing. The bug
  136. was said to be 'deep within the compiler' and not likely to be fixed in
  137. subsequent releases.
  138.  
  139. I have encountered a problem similar to this in reading character files.
  140. Reading the fields '345.67', or '3456.78' in F7.2 format works fine,
  141. until a field missing a decimal point is encountered. Then, reading a
  142. field like '2345' will result in 23.45 instead of 2345.00 being read
  143. into the real variable. I am not sure whether this is a bug or not, as
  144. the F77 spec is rather vague about what really should happen. But it's
  145. enough that I'm giving up converting characters to reals with character
  146. files; I wrote a subroutine to parse the string w.r.t.the decimal point
  147. instead.
  148. -w
  149.  
  150. ------------------------------
  151.  
  152. From:    SDCVAX::MAILER       27-MAR-1987 17:00
  153. To:    BOULDIN
  154. Subj:    MS FORTRAN
  155.  
  156. Return-Path: <mcnabb@b.cs.uiuc.edu>
  157. Received: from b.cs.uiuc.edu by CEEE-SED.ARPA ; 27 Mar 87 16:58:55 EST
  158. Received: by b.cs.uiuc.edu (UIUC-5.52/9.7)
  159.     id AA18007; Fri, 27 Mar 87 15:56:03 CST
  160. Date: Fri, 27 Mar 87 15:56:03 CST
  161. From: mcnabb@b.cs.uiuc.edu (David McNabb)
  162. Message-Id: <8703272156.AA18007@b.cs.uiuc.edu>
  163. To: bouldin@ceee-sed.arpa
  164. Subject: MS FORTRAN
  165.  
  166. I've run into another non-feature of the new (V2.2) MSF system that
  167. really should be fixed.  It does not seem to be possible to do screen
  168. dumps while the debugger is running.  We teachers would like to make
  169. and show slides on how to use the debugger.  (Luckily I made a few
  170. such screen dumps last Spring using the old version of the compiler/
  171. debugger, which DID allow screen dumps.  They look pretty much the
  172. same as the new version, so I can use these in my lectures.)
  173.  
  174. I recently tried using the "Camera" DA which I picked up off the net.
  175. This is supposed to allow you to set a timer, go off and run whatever
  176. you want, and when the timer expires a screen dump occurs.  Camera
  177. works while the compiler is running but not while the debugger is
  178. running (does the debugger clear all events on startup???).  I wonder
  179. if at least this much could be fixed to allow DAs to do snapshots.
  180.  
  181. If you still chat with MS/Absoft about their F77 system, please pass
  182. this request along to them.  Thanks.
  183.  
  184.         David McNabb
  185.  
  186.         Department of Computer Science
  187.         University of Illinois at Urbana-Champaign
  188.         USENET:    ...!{cmcl2,seismo,ihnp4}!uiucdcs!mcnabb
  189.         ARPA:    mcnabb@a.cs.uiuc.edu
  190. From:    SDCVAX::MAILER       27-MAR-1987 21:09
  191. To:    BOULDIN
  192. Subj:    Fortran 2.2 bug
  193.  
  194. Return-Path: <J.JJGH@OTHELLO.STANFORD.EDU>
  195. Received: from OTHELLO.STANFORD.EDU by CEEE-SED.ARPA ; 27 Mar 87 21:09:06 EST
  196. Date: Fri 27 Mar 87 18:05:29-PST
  197. From: Jaime Gomez <J.JJGH@OTHELLO.STANFORD.EDU>
  198. Subject: Fortran 2.2 bug
  199. To: bouldin@CEEE-SED.ARPA
  200. cc: jaime@SUMMIT
  201. Message-ID: <12289857851.10.J.JJGH@OTHELLO.STANFORD.EDU>
  202.  
  203.  
  204. Since you forwarded to Absoft the bug I posted about overlapping loops here
  205. it is another one that I found with the Debugger and I guess it won't be
  206. easy to fix.
  207.  
  208. The bug happens when using subroutines with dynamic dimension, i.e., when
  209. the dimensions are dimesions are sent in the call to the subroutine and
  210. the matrix has been dimesioned as matrix(1stdim, 2nddim,..., before-lastdim,1).
  211. In this situation the matrix cannot be examined when within the subroutine
  212. although all the computations are OK and the matrix can be examined when in
  213. _MAIN. When I say that you cannot examine the matrix I mean that the values
  214. displayed by the Debugger do not correspond at all with the values that must be.
  215.  
  216. Another problem, at least to be reported in the manual, is that all input
  217. files must have and extra blank line at the end of them for the application
  218. to detect the end of file. If that blank is not there, then the mac freezes,
  219. no error report, nothing at all.
  220.  
  221. That's all
  222.  
  223. j.jjgh@othello.stanford.edu
  224.  
  225. -------
  226. From:    SDCVAX::MAILER        4-NOV-1986 05:16
  227. To:    BOULDIN
  228. Subj:    Macintosh FORTRAN
  229.  
  230. Return-Path: <PDMMAC%MCMASTER.BITNET@WISCVM.WISC.EDU>
  231. Received: from WISCVM.WISC.EDU by CEEE-SED.ARPA ;  4 Nov 86 05:16:21 EST
  232. Received: from (PDMMAC)MCMASTER.BITNET by WISCVM.WISC.EDU on 10/31/86
  233.   at 15:23:43 CST
  234. Date:     Fri, 31 Oct 86 16:16 EDT
  235. From:        <PDMMAC%MCMASTER.BITNET@WISCVM.WISC.EDU>
  236. Subject:  Macintosh FORTRAN
  237. To:  BOULDIN@CEEE-SED.ARPA
  238. X-Original-To:  "BOULDIN@CEEE-SED.ARPA", PDMMAC
  239.  
  240. I noticed on a news file a few months ago (in Australia, actually) that you
  241. were soliciting suggestions for a future release of Microsoft FORTRAN for the
  242. Macintosh.
  243.  
  244. I have been using 2.1 and am impressed with the speed and convenience of
  245. compilation, compared to Microsoft FORTRAN on the PC.  The execution time for
  246. number-crunching compares very well with a PC and 8087, but is still slower
  247. than Lahey-compiled PC code.  It is much faster than a PC without 8087.
  248.  
  249. Can you tell me when there will be a release that can be run from a Mac +
  250. 2-sided disk or a Hard Disk??
  251.  
  252. The other improvements I would recommend are to do with treatment of double
  253. precision, and would make Mac FORTRAN behave in the same sensible way that
  254. VMS FORTRAN does on the VAX.
  255.  
  256. 1.In Mac FORTRAN,
  257.  
  258. FUNCTION FN(X)
  259. IMPLICIT DOUBLE PRECISION (F,X)
  260. FN=X*X
  261.  
  262. will not make FN double precision; you have to use, instead,
  263.  
  264. DOUBLE PRECISION FUNCTION FN(X)
  265.  
  266. I think that the IMPLICIT statement should also apply to the function.
  267.  
  268. 2. Double precision constants should be recognized by their context and not
  269. always need the D notation.  For example,
  270.  
  271. DOUBLE PRECISION A
  272. A=0.
  273. A=A+.1
  274.  
  275. should compile with .1 a double precision constant, since there is no question
  276. that it ought to be.  Mac FORTRAN will not do this unless you write
  277.  
  278. A=A+.1D0
  279.  
  280. and this is tedious when converting an old program from single to double
  281. precision.
  282.  
  283. Peter Macdonald
  284. PDMMAC@MCMASTER.BITNET
  285.  
  286. From:    SDCVAX::MAILER        3-NOV-1986 09:27
  287. To:    BOULDIN
  288. Subj:    fortran flame
  289.  
  290. Return-Path: <patnaik@nrl-lcp.ARPA>
  291. Received: from nrl-lcp.ARPA by CEEE-SED.ARPA ;  3 Nov 86 09:27:23 EST
  292. Date: 2 Nov 86 17:12:00 EDT
  293. From: "Gopal Patnaik" <patnaik@nrl-lcp.ARPA>
  294. Subject: fortran flame
  295. To: "bouldin" <bouldin@ceee-sed.arpa>
  296. Reply-To: "Gopal Patnaik" <patnaik@nrl-lcp.ARPA>
  297.  
  298. I just read your post on info-mac today.  My biggest complaint with the
  299. MS MAC FORTRAN compiler is the non-standard implementation of entries. Not
  300. only is the implementation non-standard, any mistake in the order or number
  301. or type of arguments is NOT flagged and leads to unpredictable results.
  302. This was true in even the beta test version 2.2.  I know entries are archaic
  303. (so is the programming style around here) but I would like the complier to
  304. conform to the standard.  Could you pass this on?
  305.  
  306. Thanks.
  307.  
  308. Gopal Patnaik
  309. patnaik@nrl-lcp.arpa
  310. ------
  311. ------
  312. From: wmartin@ut-ngp.UUCP (Wiley Sanders)
  313. Subject: Really Strange, Evil MacFortran Problem
  314. Date: 7 Nov 86 00:46:32 GMT
  315. Organization: UTexas Computation Center, Austin, Texas
  316.  
  317. Here is a really perplexing bug in MacFortran 2.2. I was trying to write
  318. a simple program to calculate values of a poisson distribution, and dis-
  319. covered that, in passing values to an external function, the values were
  320. being trashed during the call to the external function, *regardless of
  321. whether the parameters were touched (equated) in the function*. I was
  322. trying to get the following program to work:
  323.  
  324. C This program does not work
  325. C remove or comment out line 6 (the if/execute stmt) and it will work
  326.       program tst
  327.       real la
  328.       integer j,m
  329.       do 20 m=1,4
  330.       la=480./3600.
  331.       j=24
  332.       if (m.EQ.-1) execute 'v2:MacFortran 2.2'
  333.       write (9,fmt='(a,f14.2,2i20)') 'Bef Passing:',la,j,m
  334.       write (9,fmt='(a,f14.2)') 'Val of bugger:',bugger(la,j,m)
  335.   20  write (9,fmt='(a,f14.2,2i20)') 'Aft Passing:',la,j,m
  336.       pause
  337.       execute 'v2:macFortran 2.2'
  338.       end
  339.  
  340.       real function bugger(lambda,i,m)
  341. C just passes the factorial of the third parameter
  342.       real lambda
  343.       integer i,m
  344.       write (9,100) 'bugger:',lambda,i,m
  345.   100 format(a,f14.2,3x,2i20)
  346.       bugger=real(ifact(m))
  347.       return
  348.       end
  349.  
  350.       integer function ifact(i)
  351. C Compute Factorial
  352. C  Param - i   Returns - i!
  353.       integer i,k
  354.       ifact=1
  355.       IF (i.EQ.0) return
  356.       do 5 k=1,i
  357.     5  ifact=ifact*k
  358.       return
  359.       end
  360.  
  361. The values of la,j, and m in the main program were always trashed upon
  362. returning from the function - but for the first time only! In addition
  363. I noted that, even though m was trashed, usually to some large integer,
  364. the program still counted the do loop correctly and called
  365. the function 4 times. After two days worth of messing around, changing
  366. random stuff here and there, lo and behold, upon removing line
  367. 6 (the if/execute line, a spurious line left over from a previous version
  368. of the program that didn't work either, but accepted keyboard input and
  369. was supposed to exit upon detecting an input value of -1), the following
  370. program was created. It runs fine and the values are not trashed!
  371.  
  372. C This program works ok
  373. C comment out line 6 (the if/execute stmt) and it will work
  374.       program tst
  375.       real la
  376.       integer j,m
  377.       do 20 m=1,4
  378.       la=480./3600.
  379.       j=24
  380. C     if (m.EQ.-1) execute 'v2:MacFortran 2.2'
  381.       write (9,fmt='(a,f14.2,2i20)') 'Bef Passing:',la,j,m
  382.       write (9,fmt='(a,f14.2)') 'Val of bugger:',bugger(la,j,m)
  383.   20  write (9,fmt='(a,f14.2,2i20)') 'Aft Passing:',la,j,m
  384.       pause
  385.       execute 'v2:MacFortran 2.2'
  386.       end
  387.  
  388.       real function bugger(lambda,i,m)
  389. (EXACTLY the same as above)
  390.       return
  391.       end
  392.  
  393.       integer function ifact(i)
  394. (EXACTLY the same as above)
  395.       return
  396.       end
  397.  
  398. I know that MacFortran is extraordinarily sensitive to nulls and other
  399. spurious characters that sometimes end up in a source file, but I looked
  400. at the first file with FEdit and there are none -the file is clean.
  401.    What gives? Is MacFortran incapable of handling external functions?
  402. Anybody else have this problem? Someone should try clipping the first
  403. listing above and see is it works - maybe there is something wrong with
  404. my particular copy or something.
  405.    Meanwhile, I will valiantly try to find a workaround, But it's kind of
  406. like trying to find a workwround when you add 2+2 and get 5.
  407.  
  408.    %*!&^&#*!
  409.  
  410. -Wiley Sanders
  411.  wmartin@ngp.UTEXAS.EDU
  412.                            MacFortran 2.2 Bug
  413.  
  414. Date: Wed, 5 Nov 86 20:46:28 CST
  415. From: wmartin@ngp.utexas.edu (Wiley Sanders)
  416. Subject: MacFortran 2.2 Bug
  417. Sender:
  418. Reply-to: ngp!wmartin@ngp.utexas.edu (Wiley Sanders)
  419.  
  420. I am experiencing a rather frustrating bug with MacFortran 2.2, using external
  421. functions. I have found that upon calling an external function:
  422.       Z=FOO(A,B,C)
  423. where
  424.       REAL FUNCTION FOO(D,E,F)
  425.       FOO=D+E+F  (etc etc)
  426. and D,E, and F are not changed in the external function, that, upon return-
  427. ing from the external function, the values of A,B, and C have been trashed
  428. in the main program. This happens when the function is called the first time,
  429. but not thereafter. I have a more detailed example program available if some-
  430. one will contact me by mail, we can discuss this.
  431. -w
  432. Wiley Sanders
  433. wmartin@ut-ngp.UTEXAS.EDU
  434. Just when you thought it might be safe to use Absoft/Microsoft Fortran....
  435.  
  436. Here are 3 new bugs, two of them quite serious:
  437.  
  438. 1. The ENTRY statement is not supported as specified by ANSI standard.
  439.    Basically, all ENTRY points in a given subroutine must have the same
  440.    number and type of arguments. This is NOT listed in the appendix that lists
  441.    departures from the standard, it is NOT flagged during compilation. The
  442.    code compiles and runs, it just runs incorrectly. How thoughtful. There
  443.    are several work-arounds. My suggestion is just to break everything up
  444.    into separate modules. Ugh.
  445.  
  446. 2. Code like this:
  447.       DO 10 I=1,NBLK
  448.       L=MIN(I*128,NW)
  449.    10 WRITE(IOUNIT,rec=I+PRU-1)(ARRAY(J),J=I*128-127,L)
  450.  
  451.    Will almost certainly run wrong. The external do loop and the implied do
  452.    in the WRITE statement get in each others way. The external do is ALWAYS
  453.    executed only ONCE, regardless of the value of NBLK. Double plus ungood.
  454.    Solution: terminate the do loop with a CONTINUE statement.
  455.  
  456. 3. The linker, while much improved, has a bug writing out the linked program.
  457.    There is an error in the use of PBRename, so you can only output a linked
  458.    file to the *same* directory as that in which the linker resides. It does
  459.    work, but this is a nuisance.
  460.  
  461. Hope this stuff saves someone else all the frustration that I have been thru
  462. over the past few days tracking this stuff down. We sure could use some more
  463. vendors of Fortran compilers.
  464. From: wmartin@ut-ngp.UUCP (Wiley Sanders)
  465. Subject: Fix to Microsoft Fortran SIZERESOURCE bug.
  466. Date: 3 Apr 87 21:57:41 GMT
  467. Organization: UTexas Computation Center, Austin, Texas
  468.  
  469. There is an error in the file "resource.inc" supplied with MacFortran
  470. 2.2 that causes a bomb whenever SIZERESOURCE is called. The error is in
  471. the PARAMETER statement specifying  the trap code for SIZERESOURCE. The
  472. old, incorrect value is z'9A550000'. The correct value should be
  473. z'9A590000'.
  474.    Credit is due to Dan Kampmeier on this, who includes the correct vaue
  475. in the source for his program "McFace." -w
  476.  
  477. From: wmartin@ut-ngp.UUCP (Wiley Sanders)
  478. Subject: YA MacFortran Bug - TRIM(), blanks, and relational exp...
  479. Date: 16 Apr 87 07:20:51 GMT
  480. Organization: UTexas Computation Center, Austin, Texas
  481.  
  482. Well, here's another bug in MacFortran 2.2, and its workaround. This
  483. time it's our good friend, the TRIM intrinsic function. Mac- Fortran
  484. doesn't seem to like using TRIM in a character relational expression
  485. when the argument to TRIM is all blanks. It hangs, forcing you to hit
  486. the panic button. The bug manifests itself in the following sample
  487. program, which reads the first line of a file, and checks if the first
  488. line is equal to the character expression 'DISAGG':
  489.  
  490.       program sertst
  491.       character*80 header,trim
  492.       integer ios
  493.       logical isdisagg
  494.       character*256 inpfile
  495.       write(9,1000) 'Enter Filename'
  496.       read (9,1000) inpfile
  497. C Open file
  498.       open(1,file=inpfile,iostat=ios,status='OLD')
  499. C Check if first line of file is the character string 'DISAGG'
  500.       read(1,9000) header
  501.       isdisagg=(trim(header).eq.'DISAGG')   ! <- Dies On This Line
  502.       if (.not.isdisagg) stop 'not disagg'
  503.       pause 'Done'
  504.  9000 format(a80)
  505.  1000 format(a)
  506.       end
  507.  
  508. Most of the time, the program works fine. But when it opens a file whose
  509. first line consists only of blanks, or only a CR, it hangs. It goes
  510. ahead and pads out the character variable 'header' with 80 blanks, but
  511. it will never return from the indicated line. A workaround that works OK
  512. is:
  513.       character*80 header
  514.       character*6 tstdis
  515.     - etc -
  516.       tstdis=trim(header)          ! this works ok. Sigh.
  517.       isdisagg=tstdis.eq.'DISAGG'
  518.       if (.not.isdisagg) stop 'not disagg'
  519.     - etc -
  520.  
  521. Which points the finger at using TRIM in the character relational
  522. expression. TRIM seems to work OK otherwise, in assignment and in
  523. iolists.
  524.  
  525. Phfbltfft!
  526. -w
  527. --
  528. Wiley Sanders, Civil Engineering Dept, UT-Austin
  529. secret NSA CIA anti Soviet Iran terrorist nuclear drug decoder ring
  530.                                      - take THAT, NSA line-eater!
  531. From: remym@tekig5.TEK.COM (Remy Malan)
  532. Subject: Funny behaviour while using MS FOTRAN v2.2
  533. Date: 4 Feb 87 18:33:54 GMT
  534. Organization: Tektronix Inc., Beaverton, Or.
  535.  
  536. I have noticed something strange regarding MS FORTRAN's (v2.2) handling
  537. of REAL*8 FUNCTIONS.  i.e. The compiler *seems* to generate bad code from
  538. my examination of the assembly listings of the program.
  539.  
  540. I have included a sample pgm. to test the real*8 function call.  I have
  541. yet to make this call work w/ MS FORTRAN although I did verify the code
  542. worked on another computer.  (In fact, the original code that I was
  543. working on was tested on two other computers and found to be right on both
  544. of those.  Only on the Mac did I have problems.)
  545.  
  546. If some kind soul could verify my results or, better, tell me what I did
  547. wrong w.r.t. the MS compiler, I would appreciate an e-mail reply.  If you
  548. do verify this strange behaviour and would like to talk to MS, their
  549. product support number is: (206)-882-8089.
  550.  
  551. Yours truly,
  552. A. Remy Malan
  553. ph: (503)-627-4184
  554.  
  555. ----------------------------------------------------
  556. Here is the code (assembly fragment follows source):
  557.  
  558. C
  559. C   TEST PROGRAM FOR STRANGE BEHAVIOUR IN
  560. C   MS FORTRAN V2.2
  561. C   WRITTEN BY A. REMY MALAN  2/4/87
  562. C
  563.     PROGRAM TEST
  564.     REAL*8 SUM
  565. C
  566. C   USE THE ASSEMBLY LISTING OPTION TO EXAMINE THE ASM
  567. C   CODE FOR THE NEXT FORTRAN LINE.  I SAW A "JSR  140(A4)"
  568. C   WHICH IS CONVERT SINGLE TO DOUBLE!  THAT
  569. C   MAKES IT SEEM THAT THE COMPILER THINKS THAT FOOB()
  570. C   IS A REAL*4 WHEN IN FACT IT IS DECLARED AS REAL*8!
  571. C
  572.         SUM = FOOB()
  573. C
  574. C
  575.     PRINT *, 'TEST: SUM = ',SUM
  576.     PRINT *, 'HIT <CR> TO QUIT...'
  577.     PAUSE
  578.  
  579.       STOP
  580.     END
  581.  
  582.  
  583.  
  584.     REAL*8 FUNCTION FOOB()
  585.     REAL*8 P
  586.  
  587.     P = 25.0D+00
  588.     PRINT *, 'FOOB: P = ',P
  589.       FOOB=P
  590.  
  591.     RETURN
  592.     END
  593.  
  594. --------- end of FORTRAN ---------
  595.  
  596. Here is the assembler listing for the "sum=foob()" line:
  597. Note the "jsr  140(a4)" line!  This, according to the manual,
  598. is an intrinsic function call, CVTFL.
  599.  
  600. ;         SUM = FOOB()
  601.  
  602.         MOVE.L  #.FOOB-L00003,D1
  603. L00003: JSR     L00003(PC,D1.L)
  604.         MOVEA.L A7,A3
  605.         JSR     140(A4)        ;This is convert single to double! - ARM
  606.         MOVEM.L D0/D1,(A3)
  607.  
  608. --------- end of ASM fragment ---------
  609. From:    SDCVAX::MAILER       20-OCT-1986 14:04
  610. To:    BOULDIN
  611. Subj:    ABSoft Fortran
  612.  
  613. Return-Path: <OR.LUSTIG@Sierra.Stanford.EDU>
  614. Received: from Sierra.Stanford.EDU by CEEE-SED.ARPA ; 20 Oct 86 14:04:32 EDT
  615. Date: Mon 20 Oct 86 11:04:03-PDT
  616. From: Irvin Lustig <OR.LUSTIG@Sierra.Stanford.EDU>
  617. Subject: ABSoft Fortran
  618. To: bouldin@CEEE-SED.ARPA
  619. Message-ID: <12248351458.17.OR.LUSTIG@Sierra.Stanford.EDU>
  620.  
  621. A friend of mine has version 1.0.  I tried to have a program with
  622. multiple subroutines in each file.  The linker would not recognize
  623. the external symbols correctly.  This was true for the first version
  624. of MicroSoft Fortran as well.  I have not checked if this was fixed
  625. in later versions.
  626.  
  627. As an example:
  628.  
  629. File name: MAIN     File name: SUB2
  630. Main Program        Subroutine SUB2
  631. Subroutine SUB1     Subroutine SUB3
  632.  
  633. SUB2 and SUB3 can't call SUB1, nor can the main program or SUB1 call SUB3.
  634.  
  635. Has this bug been fixed?  I have a 10000 line program in 5 files that
  636. I want to port to the Mac.  It has about 200 or so subroutines.  I don't
  637. want to split it up into 200 files.  If the bug hasn't been fixed, it
  638. really needs to be.
  639.  
  640. Thanks in advance for your info.
  641.  
  642. -Irv Lustig
  643. or.lustig@su-sierra.arpa         (Old way)
  644. or.lustig@sierra.stanford.edu    (New way)
  645. -------
  646. I have noticed something strange regarding MS FORTRAN's (v2.2) handling
  647. of REAL*8 FUNCTIONS.  i.e. The compiler *seems* to generate bad code from
  648. my examination of the assembly listings of the program.
  649.  
  650. I have included a sample pgm. to test the real*8 function call.  I have
  651. yet to make this call work w/ MS FORTRAN although I did verify the code
  652. worked on another computer.  (In fact, the original code that I was
  653. working on was tested on two other computers and found to be right on both
  654. of those.  Only on the Mac did I have problems.)
  655.  
  656. If some kind soul could verify my results or, better, tell me what I did
  657. wrong w.r.t. the MS compiler, I would appreciate an e-mail reply.  If you
  658. do verify this strange behaviour and would like to talk to MS, their
  659. product support number is: (206)-882-8089.
  660.  
  661. Yours truly,
  662. A. Remy Malan
  663. ph: (503)-627-4184
  664.  
  665. ----------------------------------------------------
  666. Here is the code (assembly fragment follows source):
  667.  
  668. C
  669. C   TEST PROGRAM FOR STRANGE BEHAVIOUR IN
  670. C   MS FORTRAN V2.2
  671. C   WRITTEN BY A. REMY MALAN  2/4/87
  672. C
  673.         PROGRAM TEST
  674.         REAL*8 SUM
  675. C
  676. C   USE THE ASSEMBLY LISTING OPTION TO EXAMINE THE ASM
  677. C   CODE FOR THE NEXT FORTRAN LINE.  I SAW A "JSR  140(A4)"
  678. C   WHICH IS CONVERT SINGLE TO DOUBLE!  THAT
  679. C   MAKES IT SEEM THAT THE COMPILER THINKS THAT FOOB()
  680. C   IS A REAL*4 WHEN IN FACT IT IS DECLARED AS REAL*8!
  681. C
  682.         SUM = FOOB()
  683. C
  684. C
  685.         PRINT *, 'TEST: SUM = ',SUM
  686.         PRINT *, 'HIT <CR> TO QUIT...'
  687.         PAUSE
  688.  
  689.         STOP
  690.         END
  691.  
  692.  
  693.  
  694.         REAL*8 FUNCTION FOOB()
  695.         REAL*8 P
  696.  
  697.         P = 25.0D+00
  698.         PRINT *, 'FOOB: P = ',P
  699.         FOOB=P
  700.  
  701.         RETURN
  702.         END
  703.  
  704. --------- end of FORTRAN ---------
  705.  
  706. Here is the assembler listing for the "sum=foob()" line:
  707. Note the "jsr  140(a4)" line!  This, according to the manual,
  708. is an intrinsic function call, CVTFL.
  709.  
  710. ;         SUM = FOOB()
  711.  
  712.         MOVE.L  #.FOOB-L00003,D1
  713. L00003: JSR     L00003(PC,D1.L)
  714.         MOVEA.L A7,A3
  715.         JSR     140(A4)         ;This is convert single to double! - ARM
  716.         MOVEM.L D0/D1,(A3)
  717.  
  718. --------- end of ASM fragment ---------
  719.  
  720. From: traffic@ut-ngp.UUCP (Wiley Sanders)
  721. Subject: MacFortran 'include' sensitive to trailing blanks...
  722. Date: 22 Apr 87 06:09:14 GMT
  723. Organization: UTexas Computation Center, Austin, Texas
  724.  
  725. the 'include' statement is sensitive to trailing blanks! in other words,
  726. "include file.inc___" will cause an include file not found error to
  727. occur even if the file 'file.inc' is present on disk.
  728.   You can use the 'zap gremlins' feature of QUED to abolish trailing
  729. blanks. sigh -w
  730.  
  731. ------------------------------
  732.  
  733. End of INFO-MAC Digest
  734. **********************
  735.